﻿#ifndef NETWORKFRAMEMANAGER_H
#define NETWORKFRAMEMANAGER_H

#include <wx/wx.h>
#include <wx/socket.h>

class WTcpClient;
class WHttpRequest;
class WHttpResponse;
class TCPClientInfo;
class WebSocketlientInfo;

class NetworkFrameManager
{
public:
    NetworkFrameManager();
    ~NetworkFrameManager();

    /// 处理网络字符串消息
    virtual void OnTcpClientProcessNetText(WTcpClient* client,wxString mes);
    /// 处理网络二进制消息
    virtual void OnTcpClientProcessNetData(WTcpClient* client,int msgType,wxMemoryBuffer& data);
    /// 处理一个新的连接到达
    virtual void OnTcpClientProcessConnectedNet(WTcpClient* client);
    /// 处理一个连接关闭
    virtual void OnTcpClientProcessDisconnectedNet(WTcpClient* client);

    /// 处理网络字符串消息
    virtual void OnTcpServerProcessNetText(TCPClientInfo* client,wxString mes);
    /// 处理网络二进制消息
    virtual void OnTcpServerProcessNetData(TCPClientInfo* client,int msgType,wxMemoryBuffer& data);
    /// 处理一个新的连接到达
    virtual void OnTcpServerProcessConnectedNet(TCPClientInfo* client);
    /// 处理一个连接关闭
    virtual void OnTcpClientProcessDisconnectedNet(TCPClientInfo* client);    

    /// 处理网络字符串消息
    virtual void OnWebSocketProcessNetText(WebSocketlientInfo* client,wxString mes);
    /// 处理网络二进制消息
    virtual void OnWebSocketProcessNetData(WebSocketlientInfo* client,int msgType,wxMemoryBuffer& data);
    /// 处理一个新的连接到达
    virtual void OnWebSocketProcessConnectedNet(WebSocketlientInfo* client);
    /// 处理一个连接关闭
    virtual void OnWebSocketProcessDisconnectedNet(WebSocketlientInfo* client);

    /// 处理http消息
    virtual bool OnProcessHttpMessage(const WHttpRequest& request, WHttpResponse& response);
};

#endif // NETWORKFRAMEMANAGER_H
